Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New script to interactively upload preferences tr-upload-preferences #368

Merged
merged 18 commits into from
Dec 3, 2024

Conversation

michaelfarrell76
Copy link
Member

@michaelfarrell76 michaelfarrell76 commented Nov 28, 2024

Screenshot 2024-12-02 at 5 22 04 AM

This command allows for updating of preference management data to your Transcend Preference Store.

This command uses inquirer to prompt the user to
map the shape of the CSV to the shape of the Transcend API. There is no requirement for the
shape of the incoming CSV, as the script will handle the mapping process.

The script will also produce a JSON cache file, that allows for the mappings to be preserved between runs.
This can be useful if you have the same CSV shape that needs to be imported multiple times.
Once the mapping process is done once, it does not need to be done again.

Additionally, the JSON cache file will store the result of any preferences that fail to be uploaded so that the
script can be run multiple times if an issue happens.

Authentication

In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).

The API key needs the following scopes:

  • Modify User Stored Preferences
  • View Managed Consent Database Admin API
  • View Preference Store Settings

Authentication

In order to use this cli, you will first need to follow this guide in order

Arguments

Argument Description Type Default Required
auth The Transcend API key with the scopes necessary for the command. string N/A true
partition The partition key to download consent preferences to string N/A true
sombraAuth The sombra internal key, use for additional authentication when self-hosting sombra. string N/A false
transcendUrl URL of the Transcend backend. Use https://consent.us.transcend.io for US hosting. string - URL https://consent.transcend.io false
file Path to the CSV file to load preferences from string - file-path ./preferences.csv false
dryRun Whether to do a dry run only - will write results ti receiptFilepath without updating Transcend boolean false false
skipWorkflowTriggers Whether to skip workflow triggers when uploading to preference store boolean false false
skipConflictUpdates Whether to skip uploading of any records where the preference store and file have a hard conflict boolean false false
isSilent Whether to skip sending emails in workflows boolean true false
attributes Attributes to add to any DSR request if created string Tags:transcend-cli,Source:transcend-cli false
receiptFilepath Store resulting, continuing where left off string - file-path ./preference-management-upload-receipts.json false

Usage

Upload consent preferences to partition key 4d1c5daa-90b7-4d18-aa40-f86a43d2c726

yarn tr-upload-preferences --auth=$TRANSCEND_API_KEY --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726

Upload consent preferences with additional options

yarn tr-upload-preferences --auth=$TRANSCEND_API_KEY --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 --file=./preferences.csv --dryRun=true --skipWorkflowTriggers=true --skipConflictUpdates=true --isSilent=false --attributes="Tags:transcend-cli,Source:transcend-cli" --receiptFilepath=./preference-management-upload-receipts.json

Specifying the backend URL, needed for US hosted backend infrastructure.

yarn tr-upload-preferences --auth=$TRANSCEND_API_KEY --partition=4d1c5daa-90b7-4d18-aa40-f86a43d2c726 --transcendUrl=https://consent.us.transcend.io

@michaelfarrell76 michaelfarrell76 force-pushed the michaelfarrell76/upload-preferences branch from 13cd682 to f5e8462 Compare November 29, 2024 22:10
@michaelfarrell76 michaelfarrell76 changed the title [WIP] New script to interactively upload preferences New script to interactively upload preferences tr-upload-preferences Dec 2, 2024
@michaelfarrell76
Copy link
Member Author

@JonnavithulaGirish i know there is a lot here but would love to merge this so that future changes can be incremental

Copy link
Member

@JonnavithulaGirish JonnavithulaGirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<333

@michaelfarrell76 michaelfarrell76 merged commit 7fefa49 into main Dec 3, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants